//
//  ConfirmShoppingGeRenListViewController.m
//  DA_V
//
//  Created by 中亿世联前台 on 15/4/22.
//  Copyright (c) 2015年 zhouhai. All rights reserved.
//

#import "ConfirmShoppingGeRenListViewController.h"
#import "ShoppingListAddressView.h"
#import "ShoppingImageView.h"
#import "ShoppingImageScrollView.h"
#import "UIViewAdditions.h"
#import "NewButton.h"
#import "InterFace.h"
@interface ConfirmShoppingGeRenListViewController ()
@property (nonatomic, strong) ShoppingListAddressView *addressView;
@property (nonatomic, strong) ShoppingImageScrollView *shoppingScrollView;
@property (nonatomic, strong) UIScrollView *mainScrollView;
@end

@implementation ConfirmShoppingGeRenListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    if (SCREEN_HEIGHT < 568) {
        self.mainScrollView.contentSize = CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT*1.2);
    }
    
    [self createSubViews];
    [self.view addSubview:self.mainScrollView];
}

#pragma -mark 添加地址View

- (void)creareAddressView{
    
    self.addressView = [[[NSBundle mainBundle] loadNibNamed:@"Shopping_Cart_Xib" owner:self options:nil] objectAtIndex:3];
    _addressView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 100);
    self.addressView.backgroundColor = [UIColor greenColor];
    [self.mainScrollView addSubview:_addressView];
    
}

#pragma -mark 创建商品滑动图片
- (void)createShoppingScrollViewImage{
    CGRect rect = CGRectMake(0, self.addressView.bottom , SCREEN_WIDTH, 100);
    self.shoppingScrollView = [ShoppingImageScrollView  soppingImageScrollViewWithFrame:rect data:nil];
    self.shoppingScrollView.backgroundColor = [UIColor blueColor];
    self.shoppingScrollView.contentSize = CGSizeMake(SCREEN_WIDTH*2, 100);
    [self.mainScrollView addSubview:_shoppingScrollView];
    
}


#pragma -mark 创建self.view子视图

- (void)createSubViews{
    
    [self creareAddressView];
    [self createShoppingScrollViewImage];
    [self individualManUI_View];
    
}

#pragma -mark 创建展示UI
- (void)individualManUI_View{
    //总价格
    UILabel *allPrace = [[UILabel alloc]initWithFrame:CGRectMake(self.addressView.frame.origin.x, self.shoppingScrollView.bottom+10, 100, 30)];
    allPrace.text = @"总金额: 186";
    [self.mainScrollView addSubview:allPrace];
    
    //

    //返回选购
//    UIButton *backBut = [[UIButton alloc]initWithFrame:CGRectMake(okBut.right +40, workdayBut.bottom + 35, 80, 40)];
//    [backBut setTitle:@"返回选购" forState:UIControlStateNormal];
//    backBut.backgroundColor = [UIColor greenColor];
//    [self.mainScrollView addSubview:backBut];
}

#pragma -mark 点击确认按钮事件
- (void)okbutclick:(id)sender{
    
}

@end
